package org.macro.bench;

import com.ocpsoft.pretty.time.PrettyTime;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;

public class Runner {

    public static int METHOD_RUNS = 100000; //00000;
   


    Runner(Locale locale) {
        run(locale);
    }

    private void run(Locale locale) {
        PrettyTime prettyTime = new PrettyTime(locale);

        Date date = new Date();
        Calendar future = new GregorianCalendar(3000,5,3);

        for (int i = 0; i < METHOD_RUNS; i++) {
            prettyTime.format(date);
            prettyTime.format(prettyTime.approximateDuration(future.getTime()));

            prettyTime.format(date);
            prettyTime.format(prettyTime.approximateDuration(future.getTime()));

            prettyTime.calculatePreciseDuration(future.getTime());

            //Getter
            prettyTime.getUnits();
            prettyTime.getReference();
            prettyTime.getLocale();

        }
    }
}
